package system.events;

import java.util.Random;

public class HardwareEvent extends Event {
	private EventType type;
	private String state;
	private int temperature;
	private int[] position;
	Random randomEvent = new Random();

	public HardwareEvent(String state, int temperature) {
		this.type = EventType.HARDWARE;
		this.state = state;
		this.temperature = temperature;
		this.position = new int[3];
		position[0] = randomEvent.nextInt(100);
		position[1] = randomEvent.nextInt(10);
		position[2] = randomEvent.nextInt(10);

	}

	public HardwareEvent(int temperature) {
		this.type = EventType.HARDWARE;
		this.temperature = temperature;
		int i = randomEvent.nextInt(2);
		switch (i) {
		case 0:
			this.state = HardwareEventState.idle;
			break;
		case 1:
			this.state = HardwareEventState.active;
			break;
		}
		this.position = new int[3];
		position[0] = randomEvent.nextInt(100);
		position[1] = randomEvent.nextInt(10);
		position[2] = randomEvent.nextInt(10);

	}

	@Override
	public EventType getType() {
		// TODO Auto-generated method stub
		return type;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public int getTemperature() {
		return temperature;
	}

	public void setTemperature(int temperature) {
		this.temperature = temperature;
	}

	public int[] getPosition() {
		return position;
	}

	public void setPosition(int[] position) {
		this.position = position;
	}

}
